﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MyOA.Model;
using MyOA.DAL;

namespace MyOA.BLL
{
    public class DepartInfoManager
    {
        DepartInfoService departInfoService = new DepartInfoService();
        //查找所有DepartInfo信息
        public IList<DepartInfo> GetAllDepartInfo()
        {
            return departInfoService.GetAllDepartInfo();
        }
        //根据departId查找DepartInfo信息
        public DepartInfo GetDepartInfoBuDepartInfoByDepartId(int departId)
        {
            return departInfoService.GetDepartInfoBuDepartInfoByDepartId(departId);
        }
        //根据DepartName查找DepartInfo
        public DepartInfo GetDepartInfoByDepartName(string departName)
        {
            return departInfoService.GetDepartInfoByDepartName(departName);
        }
        //根据BranchId查找departInfo 数量
        public int GetCountDepartInfoByBranchId(int branchId)
        {
            return departInfoService.GetCountDepartInfoByBranchId(branchId);
        }
        //添加部门信息
        public int AddDepartInfo(DepartInfo departInfo)
        {
            return departInfoService.AddDepartInfo(departInfo);
        }
        //根据DepartId修改部门信息
        public int UpdateDepartInfoByDepartId(DepartInfo departInfo)
        {
            return departInfoService.UpdateDepartInfoByDepartId(departInfo);
        }
        //根据DepartId删除部门信息
        public int DeleteDepartInfoByDepartId(int departId)
        {
            return departInfoService.DeleteDepartInfoByDepartId(departId);
        }
        /// <summary>
        /// 根据branchId查找所有DepartInfo
        /// </summary>
        /// <param name="branchId">要查找的机构Id</param>
        /// <returns>要查找部门的机构信息</returns>
        public IList<DepartInfo> getAllDepartInfoByBranchId(int branchId)
        {
            return departInfoService.getAllDepartInfoByBranchId(branchId);
        }
        /// <summary>
        /// 根据branchId和departName查找DepartInfo
        /// </summary>
        /// <param name="branchId">选择的机构Id</param>
        /// <param name="departName">添加的部门名称</param>
        /// <returns>返回查找的对象</returns>
        public DepartInfo getDepartInfoByBranchIdAndDepartName(int branchId, string departName)
        {
            return departInfoService.getDepartInfoByBranchIdAndDepartName(branchId, departName);
        }

        /// <summary>
        /// 查询机构信息
      /// </summary>
      /// <returns></returns>
      public IList<DepartInfo> GetDepartName(int branchId)
      {
          return departInfoService.GetDepartName(branchId);
      }
    
    }
}
